package cn.hsa.fqz.handler.base;

import cn.hsa.fqz.task.service.dto.LoginUserDTO;
import cn.hsa.hsaf.core.framework.util.CurrentUser;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author luoze
 * @date 2023/5/22 11:43 上午
 */
public class BaseController {

    @Value("${zmjk.monitor.mock}")
    private boolean isMock;

    public LoginUserDTO getLoginUser(CurrentUser currentUser){
        LoginUserDTO loginUserDTO = new LoginUserDTO();
        loginUserDTO.setRegion(currentUser.getAdmDvs());
        loginUserDTO.setAccount(currentUser.getUserAcct());
        loginUserDTO.setUid(currentUser.getUserAcctID());
        loginUserDTO.setUname(currentUser.getName());
        loginUserDTO.setUtype(currentUser.getDeptID());
        if(isMock){
            loginUserDTO.setRegion("430000");
        }
        return loginUserDTO;
    }
}
